package zhklappoint.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Transient;

import org.springframework.beans.BeanUtils;
import org.springframework.util.ObjectUtils;

import zhklappoint.entity.vo.ActivityMidVo;
import zhklappoint.util.BaseEntity;

@Entity(name="zhkl_appoint_active")
public class Activity extends BaseEntity{
	
		
		@Column(length = 64)
		private String activityName;
		//背景图轮播
		@Column(length = 255)
		private String imgUrl;
		//活动页面展示的背景图
		@Column(length = 128)
		private String imgUrlback;
		//活动简介
		@Column(length = 255)
		private String intrInfo;
		//活动介绍
		@Column(columnDefinition = "text")
		private String activityDetail;
		//活动口号
		@Column(length = 64)
		private String title;
		//活动联系人电话
		@Column(length = 16)
		private String phone;
		
		//用户是否可以重复预约0无重复频率  1有重复频率
		@Column(columnDefinition = "tinyint")
		private Integer isRepeat=0;
		//重复选择频率
		@Column(length = 16)
		private Integer timesRate;
		
		
		//当前活动状态0正常预约即可  1预约中有时间因素 
		@Column(columnDefinition = "tinyint")
		private Integer status=0;
		//活动状态  0预约中  1预约失败  2预约成功  有些预约有最低预约人数 所以在没有到达这个数量的时候是会失败的
		@Column(columnDefinition = "tinyint")
		private Integer activeStatus=0;
		//对应公司的id
		@Column(length = 32)
		private String comId;
		//最低预约数量限制 如果非0 即表示预约最后成功有最低数量限制
		@Column(length = 16)
		private Integer minNum=0;
		//最多预约数量限制  作为预约的最高预约数量 
		@Column(length = 16)
		private Integer maxNum=0;
		//表示当前可预约的剩余量
		@Column(length = 16)
		private Integer leftNum=0;
		//活动开始时间
		@Column(length = 32)
		 private Long begTime;
		//活动结束时间 为0代表到长久
		@Column(length = 32)
		 private Long endTime;
		//活动点击数量
		@Column(length = 16)
		private Integer pvNum=0;
		
		//当前活动是否需要设置服务对象
		@Column(columnDefinition = "tinyint")
		private Integer isChose;
		//设置的服务对象以字符串的形式存放逗号隔开
		@Column(length=255)
		private String choseObj;
		
		//当前活动是否需要付费状态0 不用付费 1需要付费
		@Column(columnDefinition = "tinyint")
		private Integer isPay;
		//当需要付费的情况，会有下方设置
		//付费预约保留到某个时间可退货，是指设置某个时间内可以退货 时间戳
		@Column(length = 16)
		private Long storeNum=0l;
		//分账系数 百分比 平台默认分红5个点
		@Column(length = 8)
		private Integer platformRatio=5;
		//介绍人分红点数 介绍人默认分红一个点  对应中间表UserActivityMid的userphone字段
		@Column(length = 8)
		private Integer userRatio=1;
		//付费金额单位（元）
		@Column(length = 16)
		private Double price=0.00;
		//商家对应的微信商户号
		@Column(length = 16)
		private String mchId;
		
		
		//返回时 需要中间表id
		@Transient
		private String uaId;
		
		@Transient
		private List<String> activeImgList=new ArrayList<String>();
		@Transient
		private List<String> activeTopickList=new ArrayList<String>();
		
		public ActivityMidVo cloneToActivityVo(Activity activity) {
			ActivityMidVo avo=new ActivityMidVo();
			BeanUtils.copyProperties(activity,avo);
			return avo;
		}
		
		
		public Integer getIsChose() {
			return isChose;
		}
		public void setIsChose(Integer isChose) {
			this.isChose = isChose;
		}
		public String getChoseObj() {
			return choseObj;
		}
		public void setChoseObj(String choseObj) {
			this.choseObj = choseObj;
		}
		public Integer getTimesRate() {
			return timesRate;
		}
		public void setTimesRate(Integer timesRate) {
			this.timesRate = timesRate;
		}
		public Integer getIsRepeat() {
			return isRepeat;
		}
		public void setIsRepeat(Integer isRepeat) {
			this.isRepeat = isRepeat;
		}
		public String getUaId() {
			return uaId;
		}
		public void setUaId(String uaId) {
			this.uaId = uaId;
		}
		public String getImgUrlback() {
			return imgUrlback;
		}
		public void setImgUrlback(String imgUrlback) {
			this.imgUrlback = imgUrlback;
		}
		public List<String> getActiveTopickList() {
			return activeTopickList;
		}
		public void setActiveTopickList(List<String> activeTopickList) {
			this.activeTopickList = activeTopickList;
		}
		public List<String> getActiveImgList() {
			return activeImgList;
		}
		public void setActiveImgList(List<String> activeImgList) {
			this.activeImgList = activeImgList;
		}
		public String getComId() {
			return comId;
		}
		public void setComId(String comId) {
			this.comId = comId;
		}
		public String getActivityName() {
			return activityName;
		}
		public void setActivityName(String activityName) {
			this.activityName = activityName;
		}
		public String getImgUrl() {
			return imgUrl;
		}
		public void setImgUrl(String imgUrl) {
			this.imgUrl = imgUrl;
		}
		public String getIntrInfo() {
			return intrInfo;
		}
		public void setIntrInfo(String intrInfo) {
			this.intrInfo = intrInfo;
		}
		public String getActivityDetail() {
			return activityDetail;
		}
		public void setActivityDetail(String activityDetail) {
			this.activityDetail = activityDetail;
		}
		public String getTitle() {
			return title;
		}
		public void setTitle(String title) {
			this.title = title;
		}
		public Integer getStatus() {
			return status;
		}
		public void setStatus(Integer status) {
			this.status = status;
		}
		public Integer getIsPay() {
			return isPay;
		}
		public void setIsPay(Integer isPay) {
			if(ObjectUtils.isEmpty(isPay)) {
				this.isPay = 0;
			}else {
				this.isPay = isPay;
			}
			
		}
		public Integer getActiveStatus() {
			return activeStatus;
		}
		public void setActiveStatus(Integer activeStatus) {
			this.activeStatus = activeStatus;
		}
		public Integer getMinNum() {
			return minNum;
		}
		public void setMinNum(Integer minNum) {
			this.minNum = minNum;
		}
		public Integer getMaxNum() {
			return maxNum;
		}
		public void setMaxNum(Integer maxNum) {
			this.maxNum = maxNum;
		}
		public Integer getLeftNum() {
			return leftNum;
		}
		public void setLeftNum(Integer leftNum) {
			this.leftNum = leftNum;
		}
		public Long getBegTime() {
			return begTime;
		}
		public void setBegTime(Long begTime) {
			this.begTime = begTime;
		}
		public Long getEndTime() {
			return endTime;
		}
		public void setEndTime(Long endTime) {
			this.endTime = endTime;
		}
		public Integer getPvNum() {
			return pvNum;
		}
		public void setPvNum(Integer pvNum) {
			this.pvNum = pvNum;
		}
		public String getPhone() {
			return phone;
		}
		public void setPhone(String phone) {
			this.phone = phone;
		}
		public Long getStoreNum() {
			return storeNum;
		}
		public void setStoreNum(Long storeNum) {
			this.storeNum = storeNum;
		}
		public Integer getPlatformRatio() {
			return platformRatio;
		}
		public void setPlatformRatio(Integer platformRatio) {
			this.platformRatio = platformRatio;
		}
		public Integer getUserRatio() {
			return userRatio;
		}
		public void setUserRatio(Integer userRatio) {
			this.userRatio = userRatio;
		}
		public Double getPrice() {
			return price;
		}
		public void setPrice(Double price) {
			this.price = price;
		}
		public String getMchId() {
			return mchId;
		}
		public void setMchId(String mchId) {
			this.mchId = mchId;
		}
		
}
